package com.rst.model;

import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

import org.codehaus.jackson.annotate.JsonIgnoreProperties;

@Entity
@Table(name="t_subjects")
@JsonIgnoreProperties({"hibernateLazyInitializer", "handler"})
public class Subject {
	
	public static final int ACTIVE = 1;
	public static final int INACTIVE = 0;
	
	public Subject(){
		
	}

	@Id
	@GeneratedValue(strategy = GenerationType.AUTO)
	@Column(name="f_subject_id")
	private Long id;	
	
	@Column(name="f_name")
	private String name;
	
	@Column(name="f_code")
	private String code;
	
	@Column(name="f_status")
	private Integer status;
	
	@Column(name="f_created_at")
	private Date createdAt;
	
	@Column(name="f_updated_at")
	private Date updatedAt;

	@Column(name="f_section_id")
	private Long sectionId;
	
	@ManyToOne(fetch=FetchType.LAZY)
	@JoinColumn(name="f_section_id", nullable=false, insertable=false, updatable=false)
	private Section section;

	
	public Long getId() {
		return id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getCode() {
		return code;
	}

	public void setCode(String code) {
		this.code = code;
	}

	public Integer getStatus() {
		return status;
	}

	public void setStatus(Integer status) {
		this.status = status;
	}

	public Date getCreatedAt() {
		return createdAt;
	}

	public void setCreatedAt(Date createdAt) {
		this.createdAt = createdAt;
	}

	public Date getUpdatedAt() {
		return updatedAt;
	}

	public void setUpdatedAt(Date updatedAt) {
		this.updatedAt = updatedAt;
	}

	public Long getSectionId() {
		return sectionId;
	}

	public void setSectionId(Long sectionId) {
		this.sectionId = sectionId;
	}

	public Section getSection() {
		return section;
	}

	public void setSection(Section section) {
		this.section = section;
	}

	
	

}
